A node in the tree structure representing the data to export / import.
More...
A node in the tree structure representing the data to export / import.
◆ Node()
◆ ~Node()
nkExport::Node::~Node |
( |
| ) |
|
◆ getNodeNature()
- Returns
- The nature of the node. The nature of the node describes the kind of data you can expect to be able to retrieve from it.
◆ getNodeValueType()
- Returns
- The value type of the value this node holds. This describes precisely what the value inside the node is, to call the right accessor.
◆ isValueTypeNumber()
bool nkExport::Node::isValueTypeNumber |
( |
| ) |
const |
- Returns
- Whether the node has any kind of number value type inside (int, uint, long, ulong, float, double).
◆ getValueAsString()
std::string_view nkExport::Node::getValueAsString |
( |
| ) |
const |
- Returns
- The value cast as a string.
◆ getValueAsInt()
int nkExport::Node::getValueAsInt |
( |
| ) |
const |
- Returns
- The value cast as an int.
◆ getValueAsUint()
unsigned int nkExport::Node::getValueAsUint |
( |
| ) |
const |
- Returns
- The value cast as an unsigned int.
◆ getValueAsLong()
long long nkExport::Node::getValueAsLong |
( |
| ) |
const |
- Returns
- The value cast as a long (8 bytes).
◆ getValueAsUlong()
unsigned long long nkExport::Node::getValueAsUlong |
( |
| ) |
const |
- Returns
- The value cast as an unsigned long (8 bytes).
◆ getValueAsFloat()
float nkExport::Node::getValueAsFloat |
( |
| ) |
const |
- Returns
- The value cast as a float.
◆ getValueAsDouble()
double nkExport::Node::getValueAsDouble |
( |
| ) |
const |
- Returns
- The value cast as a double.
◆ getValueAsBool()
bool nkExport::Node::getValueAsBool |
( |
| ) |
const |
- Returns
- The value cast as a bool.
◆ getMemberCount()
unsigned int nkExport::Node::getMemberCount |
( |
| ) |
const |
- Returns
- The number of members the node has.
◆ getMemberKey()
std::string_view nkExport::Node::getMemberKey |
( |
unsigned int |
index | ) |
|
Allows to retrieve a key of a member, like if they were indexable. Can be used to inspect an unknown structure, for instance.
- Parameters
-
index | The index of the member key to retrieve. For instance, if a node has 5 members, it would be possible to index them from 0 to 4. |
- Returns
- The key of the member at index requested. If index is out of bounds, an empty string.
◆ getMemberValue() [1/2]
Node* nkExport::Node::getMemberValue |
( |
unsigned int |
index | ) |
|
Allows to retrieve a member, like if they were indexable. See nkExport::Node::getMemberKey for more details.
- Parameters
-
index | The index of the member to retrieve. |
- Returns
- The member at requested index. If index is out of bounds, nullptr.
◆ getMemberValue() [2/2]
Node* nkExport::Node::getMemberValue |
( |
const std::string_view & |
key | ) |
|
Allows to get a member directly from its key.
- Parameters
-
key | The key identifying the wanted member. |
- Returns
- The member at requested key. If none is existing, nullptr.
◆ getArraySize()
unsigned int nkExport::Node::getArraySize |
( |
| ) |
const |
- Returns
- The size of the array represented by the node.
◆ getArrayElement()
Node* nkExport::Node::getArrayElement |
( |
unsigned int |
index | ) |
|
- Parameters
-
index | The index at which to index the array. |
- Returns
- The attached element. If index is out of bounds, nullptr.
◆ getUserData()
void* nkExport::Node::getUserData |
( |
| ) |
const |
- Returns
- The user data attached to the node.
◆ setAsString()
void nkExport::Node::setAsString |
( |
const std::string_view & |
value | ) |
|
Converts the node to hold a string.
- Parameters
-
value | The string to attach to this node. |
◆ setAsInt()
void nkExport::Node::setAsInt |
( |
int |
value | ) |
|
Converts the node to hold an int.
- Parameters
-
value | The int to attach to this node. |
◆ setAsUint()
void nkExport::Node::setAsUint |
( |
unsigned int |
value | ) |
|
Converts the node to hold an unsigned int.
- Parameters
-
value | The unsigned int to attach to this node. |
◆ setAsLong()
void nkExport::Node::setAsLong |
( |
long long |
value | ) |
|
Converts the node to hold a long (8 bytes).
- Parameters
-
value | The long to attach to this node. |
◆ setAsUlong()
void nkExport::Node::setAsUlong |
( |
unsigned long long |
value | ) |
|
Converts the node to hold an unsigned long (8 bytes).
- Parameters
-
value | The unsigned long to attach to this node. |
◆ setAsFloat()
void nkExport::Node::setAsFloat |
( |
float |
value | ) |
|
Converts the node to hold a float.
- Parameters
-
value | The float to attach to this node. |
◆ setAsDouble()
void nkExport::Node::setAsDouble |
( |
double |
value | ) |
|
Converts the node to hold a double.
- Parameters
-
value | The double to attach to this node. |
◆ setAsBool()
void nkExport::Node::setAsBool |
( |
bool |
value | ) |
|
Converts the node to hold a boolean.
- Parameters
-
value | The bool to attach to this node. |
◆ addMember()
Node* nkExport::Node::addMember |
( |
const std::string_view & |
key | ) |
|
Converts the node as an object to hold child members.
- Parameters
-
key | The key of the member to add. |
- Returns
- The child member, empty.
◆ deleteMember()
void nkExport::Node::deleteMember |
( |
const std::string_view & |
key | ) |
|
Allows to erase a member from the node.
- Parameters
-
key | The key of the member to delete. |
◆ addElement()
Node* nkExport::Node::addElement |
( |
| ) |
|
Converts the node into an array to index children.
- Returns
- A new child, empty.
◆ setUserData()
void nkExport::Node::setUserData |
( |
void * |
value | ) |
|
Allows to attach user data to the node. This data is ignored by the component, and can be used by the client application if any information needs to be communicated by this mean.
- Parameters
-
value | The data to attach to this node. |
The documentation for this class was generated from the following file:
- Documentation/Headers/NilkinsExport/Tree/Node.h